package com.onesports.intelligent.k12.polarlight.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

@Configuration
public class PasswordEncoderConfiguration {
    @Bean
    public PasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder();
    }

//    public static void main(String[] args) {
//        PasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
//        System.out.println(DigestUtils.md5DigestAsHex("123456".getBytes()));
//        String md5 = DigestUtils.md5DigestAsHex("123456".getBytes());
//        System.out.println(md5);
//        String pwd = passwordEncoder.encode(md5);
//        System.out.println(pwd);
//    }
}
